export function timeFormat(fmt) {
    var date = new Date(fmt * 1000) //如果date为13位不需要乘1000
    var Y = date.getFullYear() + '-'
    var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
    var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' '
    var h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':'
    var m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':'
    var s = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds())
    return Y + M + D + h + m + s
}

export function numberPeople(num) {
    if (isNaN(num)) return 0.00
    if (num < 10000) return num
    if (num >=1000) return num
}
export function thousandPeople(num) {
    if (isNaN(num)) return ""
    if (num < 10000) return ".00"
    if (num >=1000) return ".00万"
}

export function  filterTel(val){
    if(val){
      return (val.substring(3, 0)) + '****' + (val.substring(7));
    }else {
        return "--"
    }
  }
  export function  filterID(val){
    if(val){
      return val.replace(/^(.{6})(?:\w+)(.{4})$/, "\$1********\$2")
    }else {
        return "--"
    }
  }
  export function  filterHtml(val){
    if(val){
      return val.replace(/<[^>]+>/g, "")
    }else {
        return "--"
    }
  }
  